]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "KeyboardStatus: handle modifier key indicators"
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 28 Jan 2011 22:51:04 +0000 (23:51 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Jan 2011 18:34:12 +0000 (19:34 +0100)
The 'show-keyboard-leds-indicator' key has been removed from
the schema.

This reverts commit 20f49e8c8917bff0d6e17ba6218fcbaec3b016e9.

js/ui/panel.js
js/ui/status/keyboard.js

index c1baf2c8a00f3703e5724dbf61cfc55d625da842..1b8863fb8571dc7c16006b672c5926622fa5ccd5 100644 (file)
@@ -43,10 +43,6 @@ const STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION = {
 if (Config.HAVE_BLUETOOTH)
     STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION['bluetooth'] = imports.ui.status.bluetooth.Indicator;
 
-const STANDARD_TRAY_INDICATOR_FACTORIES = [
-    imports.ui.status.keyboard.ModifierIndicatorFactory
-];
-
 // in org.gnome.desktop.interface
 const CLOCK_FORMAT_KEY        = 'clock-format';
 
@@ -813,16 +809,13 @@ Panel.prototype = {
 
         /* right */
 
-        // On-off indicators (for keyboard leds and accessx) are in indicatorBox
-        // System status applets live in statusBox, and legacy tray icons
+        // System status applets live in statusBox, while legacy tray icons
         // live in trayBox
         // The trayBox is hidden when there are no tray icons.
-        this._indicatorBox = new St.BoxLayout({ name: 'indicatorBox' });
         this._trayBox = new St.BoxLayout({ name: 'legacyTray' });
         this._statusBox = new St.BoxLayout({ name: 'statusTray' });
 
         this._trayBox.hide();
-        this._rightBox.add(this._indicatorBox);
         this._rightBox.add(this._trayBox);
         this._rightBox.add(this._statusBox);
 
@@ -874,13 +867,6 @@ Panel.prototype = {
     },
 
     startStatusArea: function() {
-        for (let i = 0; i < STANDARD_TRAY_INDICATOR_FACTORIES.length; i++) {
-            let factory = new STANDARD_TRAY_INDICATOR_FACTORIES[i];
-            let indicators = factory.getIndicators();
-            for (let j = 0; j < indicators.length; j++)
-                this._indicatorBox.add(indicators[j]);
-        }
-
         for (let i = 0; i < STANDARD_TRAY_ICON_ORDER.length; i++) {
             let role = STANDARD_TRAY_ICON_ORDER[i];
             let constructor = STANDARD_TRAY_ICON_SHELL_IMPLEMENTATION[role];
index 3813c62de5cdaf93a507d30bd34aa4ece50e9754..6e6ccee54f93ec8e2fdcde542be80615ea112427 100644 (file)
@@ -204,52 +204,3 @@ XKBIndicator.prototype = {
             this._labelActors[i].allocate_align_fill(box, 0.5, 0, false, false, flags);
     }
 };
-
-function ModifierIndicatorFactory() {
-    this._init.call(this);
-}
-
-ModifierIndicatorFactory.prototype = {
-    _init: function() {
-        this._settings = new Gio.Settings({ schema: INDICATOR_SCHEMA });
-        this._settings.connect('changed::show-keyboard-leds-indicator', Lang.bind(this, this._changed));
-
-        this._config = Gkbd.Configuration.get();
-        this._config.connect('indicators-changed', Lang.bind(this, this._changed));
-
-        this._scrollLock = new St.Icon({ icon_name: 'kbdled-scroll-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
-        this._numLock = new St.Icon({ icon_name: 'kbdled-num-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
-        this._capsLock = new St.Icon({ icon_name: 'kbdled-caps-lock', icon_type: St.IconType.SYMBOLIC, style_class: 'system-status-icon' });
-
-        this._changed();
-    },
-
-    getIndicators: function() {
-        return [this._scrollLock, this._numLock, this._capsLock];
-    },
-
-    _changed: function() {
-        let enable = this._settings.get_boolean('show-keyboard-leds-indicator');
-
-        if (enable) {
-            if (this._config.get_scroll_lock_state())
-                this._scrollLock.show();
-            else
-                this._scrollLock.hide();
-
-            if (this._config.get_num_lock_state())
-                this._numLock.show();
-            else
-                this._numLock.hide();
-
-            if (this._config.get_caps_lock_state())
-                this._capsLock.show();
-            else
-                this._capsLock.hide();
-        } else {
-            this._scrollLock.hide();
-            this._numLock.hide();
-            this._capsLock.hide();
-        }
-    }
-};